<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" manifest="cache.manifest">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="initial-scale=1.0; user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="no" />
	<link rel="apple-touch-icon" href="icon.png"/>
    <title>Où?</title>
    <style type="text/css">
	  body {
	  	padding: 0px;
	  	margin: 0px;
        font: normal 1.2em Arial, sans-serif;
        color: #555;
	  }
      
      #menu {
    	 position:absolute;
    	 z-index: 10;
    	 bottom: 50px;
    	 left: 8px;
    	 padding: 3px;
      }
      
      #menu li {
      	display:inline;
      }
      
      #menu ol {
      	padding: 0;
      	margin: 0;
      }
      
      a:hover {
      	text-decoration: underline;
      }
      
      body a {
      	text-decoration:none;
      	color: #006699;
      }
      
      #info {
      	background-color: white;
      }
      
  	</style>
    <script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
    <script type="text/javascript" src="json2.js"></script>
    <script type="text/javascript" src="gears_init.js"></script>
    <script type="text/javascript" src="sylvek_client.js"></script>
    <script type="text/javascript" src="script.js"></script>
    <script type="text/javascript" src="script-only-html5.js"></script>
    <script type="text/javascript" src="mdetect.js"></script>
    <script type="text/javascript" src="api_key.js"></script>
  </head>
  <body>
  <div id="menu"> 
   	<div id="info"></div>
   	<ol>
   		<li>
   			<select onchange="selectFriends(this.value);">
   				<option value="myfriends" selected>show my friends</option>
   				<option value="nearme">show peoples near me</option>
   				<option value="all">show the last updates</option>
   				<option value="online">show online peoples</option>
   			</select>
   		</li>
   		<li><button onclick="share();">share my location by mail</button></li>
   		<li><button onclick="disconnect();unregister();">disconnect</button></li>
   	</ol>
  </div> 
  <div id="map_canvas" style="width:100%; height:100%; margin:0; padding:0">
  	<p><a href='../index.html'>full html5 browser is needed to find your friends with this version</a></p>
  </div>
	<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
	<script type="text/javascript">
		initialize();

		if(DetectSmartphone()) {
			level = 10;
			prefix = "m";
		}

		if(!isConnected()) {
		    FB_RequireFeatures(["XFBML"], function() {
		        FB.Facebook.init(API_KEY, "xd_receiver.htm", {permsToRequestOnConnect : "email"});
		        var api = FB.Facebook.apiClient;
		        api.requireLogin(function(exception) {
		        	api.users_getInfo (api.get_session().uid,"name",function(result, exception) {
		        		uid = api.get_session().uid;
		        		name = result[0].name;
		        		showTime();
		        		api.friends_get(null, function(result) {
							myfriends = result;
			        		if(isLocalStorage) { updateStorage(uid, name, myfriends); }
			        		selectFriends("myfriends");
				        });
		            });
		    	});
		    });
		} else if(isLocalStorage) {
			uid = localStorage.getItem("uid");
			name = localStorage.getItem("name");
			myfriends = localStorage.getItem("myfriends");
	      	showTime();
		}
	</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-817536-15']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();

</script>
  </body>
</html>
